package calendar;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.Serializable;
import javax.swing.JPanel;

/* main calendar panel which other panels are derived from */
public class CalendarPanel extends JPanel 
                           implements ActionListener, Serializable {

    private static final long serialVersionUID = 32589234L;

  public void actionPerformed(ActionEvent e) {
    throw new UnsupportedOperationException("Not supported yet.");
  }

  void fireCalEvent( CalEvent calEvent )
  {
    Object[] listeners = listenerList.getListenerList();

    for ( int i = 0; i < listeners.length; i++ )
    {
      if ( listeners[i] == CalEventListener.class )
      {
        CalEventListener calEventListener;
        calEventListener = (CalEventListener)listeners[i+1];
        calEventListener.calEventOccurred( calEvent );
      }
    }
  }

  void addCalEventListener ( CalEventListener reListener )
  {
    listenerList.add ( CalEventListener.class, reListener ) ;
  }

  void removeCalEventListener ( CalEventListener reListener )
  {
    listenerList.remove ( CalEventListener.class, reListener ) ;
  }
}
